package cn.dinxian.entity;

import com.fasterxml.jackson.annotation.JsonFormat;


import java.util.Date;
import java.util.List;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
//import org.activiti.api.process.model.ProcessInstance;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ActTaskDTO
    extends PageDTO {

  private static final long serialVersionUID = 1L;
  private String id;
  private String name;

  private String status;

  private String taskId;

  private String taskName;

  private String description;

  private Integer priority;

  private String owner;

  private String assignee;

  private String processInstanceId;

  private String executionId;

  private String processDefinitionId;

  private Date createTime;

  private String taskDefinitionKey;

  private Date dueDate;

  private String category;

  private String parentTaskId;

  private String tenantId;
  
  private String formKey;

  private Map<String, Object> taskLocalVariables;

  private Map<String, Object> processVariables;

  private Date claimTime;
  private String businessKey;
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date createdDate;
  private String instanceName;
  private String definitionKey;
  
  private String userId;
  
  private String roleId;
  
  private List<String> listParam;
  
  private List<String> groupList;
  
  
  
  
  public ActTaskDTO(ActTaskDTO task, MyProcessInstance processInstance) {
    //this.id = task.getId();
    this.id = task.getTaskId();
    this.name = task.getTaskName();
    this.status = task.getStatus();
    this.createdDate = task.getCreateTime();
    this.instanceName = processInstance.getProcessInstanceName();
    this.definitionKey = processInstance.getProcessDefinitionKey();
    this.businessKey = processInstance.getBusinessKey();
  }


}
